import myaxios from '../Axios'
import BaseUrl from '../BaseUrl'
const {BASEURL} = BaseUrl
const dishApi={
    // 新增菜品
    add(params:object){
        return myaxios.post(BASEURL+'/dish/add',params)
    },

    //查询所有菜品
    queryAll(params?:object){
        return myaxios.get(BASEURL+'/dish/list',params)
    },

    // 通过id查询所有菜品
    queryById(params:number){
        return myaxios.get(BASEURL+`/dish/queryById?dishId=${params}`)
    },

    // 修改菜品
    modify(params:object){
        return myaxios.post(BASEURL+'/dish/modify',params)
    },

    // 删除菜品
    del(params:number){
        return myaxios.get(BASEURL+`/dish/delete?dishId=${params}`)
    },
    // 分页查询
    queryByPage(params:object){
        return myaxios.get(BASEURL+'/dish/page',params)
    }
    
}

export default dishApi;